//
//  XYTableViewCellModel.h
//  xylink_app
//
//  Created by chengronggang on 2021/1/21.
//  Copyright © 2021 ainemo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef UITableViewCell * (^XYCellRenderBlock)(NSIndexPath *indexPath, UITableView *tableView);
typedef NSIndexPath * (^XYCellWillSelectBlock)(NSIndexPath *indexPath, UITableView *tableView);
typedef void (^XYCellSelectionBlock)(NSIndexPath *indexPath, UITableView *tableView);
typedef void (^XYCellWillDisplayBlock)(UITableViewCell *cell, NSIndexPath *indexPath, UITableView *tableView);
typedef void (^XYCellCommitEditBlock)(NSIndexPath *indexPath, UITableView *tableView,
                                       UITableViewCellEditingStyle editingStyle);

/** Table view's row model */
@interface XYTableViewCellModel : NSObject

@property (nonatomic, copy) XYCellRenderBlock renderBlock;            // required
@property (nonatomic, copy) XYCellWillDisplayBlock willDisplayBlock;  // optional
@property (nonatomic, copy) XYCellWillSelectBlock willSelectBlock;    // optional
@property (nonatomic, copy) XYCellWillSelectBlock willDeselectBlock;  // optional
@property (nonatomic, copy) XYCellSelectionBlock selectionBlock;      // optional
@property (nonatomic, copy) XYCellSelectionBlock deselectionBlock;    // optional
@property (nonatomic, copy) XYCellCommitEditBlock commitEditBlock;    // optional
// if not specified, will use UITableViewAutomaticDimension as default value
@property (nonatomic, assign) CGFloat height;  // optional
@property (nonatomic, assign) BOOL canEdit;    // default NO
//@property (nonatomic, assign) BOOL canMove;   //default NO
@property (nonatomic, assign) UITableViewCellEditingStyle editingStyle;  // cell's editing style
@property (nonatomic, copy) NSString *deleteConfirmationButtonTitle;  // delete confirmation title

@end
